home *** CD-ROM | disk | FTP | other *** search
/ Leonardo the Inventor / Leonardo The Inventor (93026)(Broderbund)(Riverdeep)(2004).iso / LEOWINMV / ICARUS.DIR / 00199_Script_199 < prev    next >
Text File  |  1996-03-28  |  4KB  |  179 lines

  1.  
  2. on ICARUS_PRELOAD
  3.   global falling
  4.   if falling then 
  5.     gameOver
  6.   else
  7.     unload (marker (-1)), (the frame - 1)
  8.     preload marker (1)
  9.   end if
  10. end ICARUS_PRELOAD
  11.  
  12. on ICARUS_PRELOAD_FIRST -- For first game frame
  13.   unload 1, (the frame - 1)
  14.   preload marker (1)
  15. end ICARUS_PRELOAD
  16.  
  17. on resetGame
  18.   
  19.   puppetSound 0
  20.   
  21.   global manSprite
  22.   global dangerSprite1, dangerSprite2
  23.   global manConstraintSprite
  24.   set manSprite = 11
  25.   set dangerSprite1 = 4
  26.   set dangerSprite2 = 5
  27.   set manConstraintSprite = 13
  28.   
  29.   global manSpeed
  30.   set manSpeed = 32
  31.   
  32.   global manCastFirst, manCastLast, manCastCurrent
  33.   set manCastFirst = 1
  34.   set manCastLast = 16
  35.   set manCastCurrent = manCastFirst
  36.   
  37.   global fallCastFirst, fallCastLast
  38.   set fallCastFirst = 17
  39.   set fallCastLast = 65
  40.   
  41.   global leftKey, rightKey
  42.   set leftKey = "jaJA"
  43.   set rightKey = "lsLS"
  44.   
  45.   puppetSprite manSprite, true
  46.   set the constraint of sprite manSprite to manConstraintSprite
  47.   
  48.   when keyDown then checkManKey
  49.   
  50.   setFalling False
  51.   
  52. end resetGame
  53.  
  54. on endGame
  55.   noPuppets
  56.   when keyDown then nothing
  57. end endGame
  58.  
  59. on noPuppets
  60.   repeat with s = 1 to 24
  61.     puppetSprite s, false
  62.   end repeat
  63. end noPuppets
  64.  
  65. on gameLoop
  66.   go "gameLoop"
  67. end gameLoop
  68.  
  69. on doGameFrame
  70.   global falling
  71.   if falling then 
  72.     advanceFallCast 
  73.   else
  74.     advanceManCast
  75.     checkCollision
  76.   end if
  77. end doGameFrame
  78.  
  79. on advanceManCast
  80.   global manCastFirst, manCastLast, manCastCurrent
  81.   global manSprite
  82.   
  83.   set manCastCurrent = manCastCurrent + 1
  84.   if manCastCurrent > manCastLast then
  85.     set manCastCurrent = manCastFirst
  86.   end if
  87.   
  88.   set the castNum of sprite manSprite to manCastCurrent
  89.   
  90. end advanceManCast
  91.  
  92. on checkManKey
  93.   global leftKey, rightKey
  94.   put the key into whichKey
  95.   if  "!" contains whichKey then
  96.     go marker (1)
  97.     exit
  98.   end if
  99.   if leftKey contains whichKey then
  100.     moveManLeft
  101.   else if rightKey contains whichKey then
  102.     moveManRight
  103.   end if
  104. end checkManKey
  105.  
  106. on moveManLeft
  107.   global manSprite, manSpeed
  108.   put the locH of sprite manSprite into man_LocH
  109.   set man_LocH = man_LocH - manSpeed
  110.   set the locH of sprite manSprite = man_LocH
  111. end moveMan
  112.  
  113. on moveManRight
  114.   global manSprite, manSpeed
  115.   put the locH of sprite manSprite into man_LocH
  116.   set man_LocH = man_LocH + manSpeed
  117.   set the locH of sprite manSprite = man_LocH
  118. end moveManRight
  119.  
  120. on checkCollision
  121.   global dangerSprite1, dangerSprite2
  122.   checkSpriteCollision dangerSprite1
  123.   checkSpriteCollision dangerSprite2  
  124. end checkCollision
  125.  
  126. on checkSpriteCollision whichSprite
  127.   global manSprite
  128.   
  129.   if sprite manSprite intersects whichSprite then
  130.     collided whichSprite
  131.   end if
  132. end checkSpriteCollision
  133.  
  134. on collided whichSprite
  135.   manStartFall
  136. end collided
  137.  
  138. on manStartFall
  139.   global manSprite
  140.   global manCastFirst, manCastLast, manCastCurrent  
  141.   global fallCastFirst, fallCastLast
  142.   
  143.   setFalling true
  144.   set manCastCurrent = fallCastFirst
  145.   
  146.   puppetSound "FALLING.AIF"
  147. end manStartFall
  148.  
  149. on advanceFallCast
  150.   global fallCastLast, manCastCurrent
  151.   global manSprite
  152.   
  153.   set manCastCurrent = manCastCurrent + 1
  154.   if manCastCurrent > fallCastLast then
  155.     gameOver
  156.   end if
  157.   
  158.   set the castNum of sprite manSprite to manCastCurrent
  159.   
  160. end advanceFallCast
  161.  
  162. on setFalling trueOrFalse
  163.   global falling
  164.   set falling = trueOrFalse
  165. end setFalling
  166.  
  167. on gameOver
  168.   endGame
  169.   puppetTransition 51, 4, 8, false
  170.   go frame "Instructions"
  171. end gameOver
  172.  
  173. on returnFromIcarus
  174.   go frame "Wing Menu" of movie "I_WING"
  175. end returnFromIcarus
  176.  
  177. on pauseFrame
  178.   go the frame
  179. end pauseFrame